package itsm.isperp.module.entity.app;

import java.util.Collection;

import itsm.isperp.framework.domain.IRole;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.security.core.GrantedAuthority;

/**
 * 
 * 
 * @author lizx
 * @date 2013-2-16
 * @version V1.0
 */
@Entity
@Table(name = "app_role")
public class AppRole implements IRole {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	protected String id;

	@Column
	protected String name;

	@Column
	protected String description;

	@Column
	protected String rights;

	@Column
	protected boolean status;

	@Column
	protected int dataRange;

	@Column
	protected String type;

	@Column
	int orderNum;

	public int getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(int orderNum) {
		this.orderNum = orderNum;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getRights() {
		return rights;
	}

	public void setRights(String rights) {
		this.rights = rights;
	}

	public boolean getStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	@Override
	public String getType() {

		return this.type;
	}

	@Override
	public void setType(String type) {
		this.type = type;
	}

	public int getDataRange() {
		return dataRange;
	}

	public void setDataRange(int dataRange) {
		this.dataRange = dataRange;
	}

	@Override
	public String getAuthority() {
		return this.id;
	}

	@Override
	public Collection<? extends GrantedAuthority> getReachableGrantedAuthorities(
			Collection<? extends GrantedAuthority> authorities) {
		// TODO Auto-generated method stub
		return null;
	}

}
